<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateStoresTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('stores', function (Blueprint $table) {
            $table->id();
            $table->integer('aid')->default(0)->comment('所属管理员ID');
            $table->string('name', 128)->default('')->comment('名称');
            $table->string('logo', 256)->default('')->comment('logo');
            $table->string('store_pass', 128)->default('')->comment('店铺密码');
            $table->string('legal_person', 32)->default('')->comment('法人');
            $table->string('license', 256)->default('')->comment('执照');
            $table->tinyInteger('status')->default(0)->comment('状态');
            $table->timestamps();
            $table->index('aid');
            $table->index('name');
            $table->index('status');
        });
        DB::statement("ALTER TABLE `stores` comment '商店表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('stores');
    }
}
